Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-es2015-modules-commonjs

Package Overview
Dependencies
Maintainers
6
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-es2015-modules-commonjs

This plugin transforms ES2015 modules to CommonJS

  • 6.26.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8M
decreased by-7.45%
Maintainers
6
Weekly downloads
 
Created

What is babel-plugin-transform-es2015-modules-commonjs?

The babel-plugin-transform-es2015-modules-commonjs npm package is a plugin for Babel that transforms ECMAScript 2015 modules to CommonJS syntax. This allows developers to write their JavaScript code using the ES2015 module syntax and then compile it down to a format that is compatible with environments that only support CommonJS modules, such as Node.js.

What are babel-plugin-transform-es2015-modules-commonjs's main functionalities?

Transform ES2015 import statements to CommonJS require

This feature allows developers to use the ES2015 import syntax and have it compiled into CommonJS require statements.

import { square } from './math';
// Transforms to:
var _math = require('./math');
var square = _math.square;

Transform ES2015 export statements to CommonJS exports

This feature enables the use of ES2015 export syntax which is then compiled into CommonJS exports.

export const square = (n) => n * n;
// Transforms to:
exports.square = (n) => n * n;

Other packages similar to babel-plugin-transform-es2015-modules-commonjs

Keywords

FAQs

Package last updated on 26 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc